package model;

import android.graphics.PointF;


/* 
 * represents a location on the screen where the screen is a matrix in the given values 
 */ 
public class CustomPoint{
	private static SizeF appScreenSize;
	private static SizeF editorScreenSize;
	
	private PointF point;
	
	
	private int rowNum;
	private int columnNum;
	
	private int MatrixSizeRows;
	private int MatrixSizeColumns;
	
	/*
	 * @preCondition (rowNum <= matrixSizeRows && columnNum <= matrixSizeColumns)
	 */
	public CustomPoint(int rowNum, int columnNum, int matrixSizeRows,
			int matrixSizeColumns) {
		super();

		this.rowNum = rowNum;
		this.columnNum = columnNum;
		MatrixSizeRows = matrixSizeRows;
		MatrixSizeColumns = matrixSizeColumns;

	}
	
	
	public static SizeF getAppScreenSize() {
		return appScreenSize;
	}


	public static void setAppScreenSize(SizeF appScreenSize) {
		CustomPoint.appScreenSize = appScreenSize;
	}


	public static SizeF getEditorScreenSize() {
		return editorScreenSize;
	}


	public static void setEditorScreenSize(SizeF editorScreenSize) {
		CustomPoint.editorScreenSize = editorScreenSize;
	}


	public PointF getPoint() {
		PointF normalizedPoint = new PointF();
		normalizedPoint.x = this.point.x*(appScreenSize.width/editorScreenSize.width); 
		normalizedPoint.y = this.point.y*(appScreenSize.height/editorScreenSize.height);
		return normalizedPoint;
	}


	public void setPoint(PointF point) {
		this.point = point;
	}


	public CustomPoint(PointF point) {
		this.point = point;
		
	}
	public int getRowNum() {
		return rowNum;
	}
	public void setRowNum(int rowNum) {
		this.rowNum = rowNum;
	}
	public int getColumnNum() {
		return columnNum;
	}
	public void setColumnNum(int columnNum) {
		this.columnNum = columnNum;
	}
	public int getMatrixSizeRows() {
		return MatrixSizeRows;
	}
	public void setMatrixSizeRows(int matrixSizeRows) {
		MatrixSizeRows = matrixSizeRows;
	}
	public int getMatrixSizeColumns() {
		return MatrixSizeColumns;
	}
	public void setMatrixSizeColumns(int matrixSizeColumns) {
		MatrixSizeColumns = matrixSizeColumns;
	}

	public static class SizeF
	{
		public float height;
		public float width;		
	}

}
